﻿using System;
using System.Collections.Generic;
using System.Xml.Serialization;

namespace Report.Entity
{
    public class ImageSettings : List<ImageSetting>
    {
        public ImageSetting GetByName(string name)
        {
            return Find(delegate(ImageSetting current)
                            {
                                return string.Equals(current.Name, name, StringComparison.InvariantCultureIgnoreCase);
                            });

        }

        public ImageSetting GetByUrl(string url)
        {
            return Find(delegate(ImageSetting current)
                            {
                                return url.IndexOf(current.Url, StringComparison.CurrentCultureIgnoreCase) > -1;
                            });
        }
    }

    public class ImageSetting
    {
        public string Name { get; set; }

        public List<Step> Steps { get; set; }

        public string TemplateFile { get; set; }

        public string Url { get; set; }
    }

    public class Step
    {
        public string BookMarkName { get; set; }

        public string Name { get; set; }

        [XmlAttribute()]
        public string Type { get; set; }

        public List<string> Expressions { get; set; }
    }
}